<html>
<head>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="style.css" />
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeRDark.css" rel="stylesheet" type="text/css" />
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js" type="text/javascript"></script>
<script type="text/javascript">
SyntaxHighlighter.all();
</script>
</head>
<body>
<div class="header" style="border-top: 1px solid #C9D7F1;margin: 9px;margin-top: 24px;padding-top: 5px;margin-bottom: 10px;">
    <a href="http://code.google.com/p/yuki/"><img src="http://code.google.com/p/yuki/logo?cct=1297980533" /></a>
    <div style="display: inline-block;padding-left: 11px;">
        <div class="project-name">
            <a style="text-decoration: none;color: #666;font-family: arial, sans-serif;font-size: 39px;" href="http://code.google.com/p/yuki/">yuki</a>
        </div>
        <div class="project-summary">
            <a href="http://code.google.com/p/yuki/" style="text-decoration: none;color: #444;font-family: arial, sans-serif;font-size: 13px;">Yuki PHP Framework</a>
        </div>
    </div>
</div>
<table width="100%"><tr><td width="200" valign="top">
<div class="sidebar"><ul><li class="package">yuki<ul><li class="subpackage">autoload<ul><li class="class"><a href="yAutoloader.html">yAutoloader</a></li><li class="class"><a href="yCoreAutoloader.html">yCoreAutoloader</a></li></ul></li><li class="subpackage">output<ul><li class="class"><a href="yBuffer.html">yBuffer</a></li></ul></li><li class="subpackage">callable<ul><li class="class"><a href="yCallable.html">yCallable</a></li></ul></li><li class="subpackage">debug<ul><li class="class"><a href="yDebugger.html">yDebugger</a></li></ul></li><li class="subpackage">geometry<ul><li class="class"><a href="yDimension.html">yDimension</a></li><li class="class"><a href="yPoint.html">yPoint</a></li><li class="class"><a href="yRectangle.html">yRectangle</a></li></ul></li><li class="subpackage">doc<ul><li class="class"><a href="yDocBlock.html">yDocBlock</a></li><li class="class"><a href="yDocumentor.html">yDocumentor</a></li><li class="class"><a href="yMethodDocumentor.html">yMethodDocumentor</a></li></ul></li><li class="subpackage">exception<ul><li class="class"><a href="yException.html">yException</a></li><li class="class"><a href="yExceptionHandler.html">yExceptionHandler</a></li></ul></li><li class="subpackage">file<ul><li class="class"><a href="yFile.html">yFile</a></li></ul></li><li class="subpackage">log<ul><li class="class"><a href="yLogMessage.html">yLogMessage</a></li><li class="class"><a href="yLogRoute.html">yLogRoute</a></li><li class="class"><a href="yLogger.html">yLogger</a></li><li class="class"><a href="yStderrLogRoute.html">yStderrLogRoute</a></li><li class="class"><a href="yStdoutLogRoute.html">yStdoutLogRoute</a></li><li class="class"><a href="yStreamLogRoute.html">yStreamLogRoute</a></li></ul></li><li class="subpackage">profiler<ul><li class="class"><a href="yProfiler.html">yProfiler</a></li></ul></li><li class="subpackage">uri<ul><li class="class"><a href="yUri.html">yUri</a></li><li class="class"><a href="yUriAuthority.html">yUriAuthority</a></li><li class="class"><a href="yUriFragment.html">yUriFragment</a></li><li class="class"><a href="yUriPath.html">yUriPath</a></li><li class="class"><a href="yUriQuery.html">yUriQuery</a></li><li class="class"><a href="yUriScheme.html">yUriScheme</a></li></ul></li></ul></li></ul></div>            
</td><td valign="top">
            
<h1>yPoint</h1>
<div><b>@package</b> yuki</div>
<div><b>@subpackage</b> geometry</div>

<!-- Hierarhy -->

<h2>Introduction</h2>
yPoint - java.awt.Point implementation<br />
A point representing a location in (x,y) coordinate space, <br />
specified in integer precision.<br />
<br />


<h2>Method Summary</h2>
<div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.__construct">__construct</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;">Constructor.</div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.equals">equals</a>(<span class="param">$point</span>);</div><div style="font-size: 11px; margin-top: 1em;">Determines whether or not two points are equal.</div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">yPoint <a href="#method.setLocation">setLocation</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;">Sets the location of the point to the specified location.</div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">yPoint <a href="#method.getLocation">getLocation</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;">Returns the location of this point.</div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">yPoint <a href="#method.move">move</a>(<span class="param">$x, $y</span>);</div><div style="font-size: 11px; margin-top: 1em;">Moves this point to the specified location in the (x, y) coordinate plane.</div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">yPoint <a href="#method.translate">translate</a>(<span class="param">$dx, $dy</span>);</div><div style="font-size: 11px; margin-top: 1em;">Translates this point, at location (x,y)</div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.setX">setX</a>(<span class="param">$x</span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method"><a href="#method.setY">setY</a>(<span class="param">$y</span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">double <a href="#method.getX">getX</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;">Returns the X coordinate of the point in double precision.</div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">double <a href="#method.getY">getY</a>(<span class="param"></span>);</div><div style="font-size: 11px; margin-top: 1em;">Returns the Y coordinate of the point in double precision.</div></div>
<h2>Method Details</h2>
<div style="padding: 4px;border: solid 1px #666;"><a name="method.__construct"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.__construct">__construct</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Constructor.
</h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function __construct(){
        // Point()
        // Constructs and initializes a point at the origin (0, 0) of the coordinate space.
        // Point(int, int)
        // Constructs and initializes a point at the specified (x, y) location in the coordinate space.
        // Point(Point)
        // Constructs and initializes a point with the same location as the specified Point object.
        $args = func_get_args();
        switch (func_num_args()){
            case 1:
                $arg = func_get_arg(0);
                if ($arg instanceof yPoint){
                    $this-&gt;_x = $arg-&gt;getX();
                    $this-&gt;_y = $arg-&gt;getY();
                }
                break;
            case 2:
                $this-&gt;_x = $args[0];
                $this-&gt;_y = $args[1];
                break;
            default:
                break;
        }
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.equals"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.equals">equals</a>(<span class="param">$point</span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div><b style="color: #683B00;">$point
</b> (bool) </div><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Determines whether or not two points are equal.
</h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function equals($point){
        return ($this-&gt;_x == $point-&gt;getX() &amp;&amp; $this-&gt;_y == $point-&gt;getY());
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.setLocation"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">yPoint <a href="#method.setLocation">setLocation</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Sets the location of the point to the specified location.
</h3></div></div><div><b>returns</b> yPoint </div></div></div><h3>Source Code</h3><pre class="brush: php">    public function setLocation(){
        $args = func_get_args();
        switch (func_num_args()){
            case 1:
                $point = array_shift($args);
                $this-&gt;_x = $x-&gt;getX();
                $this-&gt;_y = $x-&gt;getY();
                break;
            case 2:
                $x = array_shift($args);
                $y = array_shift($args);
                $this-&gt;_x = $x;
                $this-&gt;_y = $y;
                break;
        }
        return $this;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getLocation"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">yPoint <a href="#method.getLocation">getLocation</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Returns the location of this point.
</h3></div></div><div><b>returns</b> yPoint </div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getLocation(){
        return $this;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.move"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">yPoint <a href="#method.move">move</a>(<span class="param">$x, $y</span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div><b style="color: #683B00;">$x
</b> (int) </div><div><b style="color: #683B00;">$y
</b> (int) </div><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Moves this point to the specified location in the (x, y) coordinate plane.
</h3></div></div><div><b>returns</b> yPoint </div></div></div><h3>Source Code</h3><pre class="brush: php">    public function move($x, $y){
        $this-&gt;_x = $x;
        $this-&gt;_y = $y;
        return $this;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.translate"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">yPoint <a href="#method.translate">translate</a>(<span class="param">$dx, $dy</span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div><b style="color: #683B00;">$dx
</b> (int) </div><div><b style="color: #683B00;">$dy
</b> (int) </div><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Translates this point, at location (x,y)
</h3></div>by dx along the x axis and dy along the y axis 
<br />so that it now represents the point (x+dx,y+dy).
</div><div><b>returns</b> yPoint </div></div></div><h3>Source Code</h3><pre class="brush: php">    public function translate($dx, $dy){
        $this-&gt;_x += $dx;
        $this-&gt;_y += $dy;
        return $this;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.setX"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.setX">setX</a>(<span class="param">$x</span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function setX($x){
        $this-&gt;_x = $x;
        return $this;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.setY"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method"><a href="#method.setY">setY</a>(<span class="param">$y</span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public function setY($y){
        $this-&gt;_y = $y;
        return $this;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getX"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">double <a href="#method.getX">getX</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Returns the X coordinate of the point in double precision.
</h3></div></div><div><b>returns</b> double </div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getX(){
        return (double) $this-&gt;_x;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getY"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">double <a href="#method.getY">getY</a>(<span class="param"></span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Returns the Y coordinate of the point in double precision.
</h3></div></div><div><b>returns</b> double </div></div></div><h3>Source Code</h3><pre class="brush: php">    public function getY(){
        return (double) $this-&gt;_y;
    }
</pre></div>


<h2>Class synopsis</h2>
<div class="classsynopsis">
<b class="classname">yPoint</b> {
<div class="contents">
<h3>/* Properties */</h3>
<div class="property">protected <a href="#property._x">$_x</a>;</div><div class="property">protected <a href="#property._y">$_y</a>;</div>
<h3>/* Methods */</h3>
<div class="method"><a href="#method.__construct">__construct</a>(<span class="param"></span>);</div><div class="method"><a href="#method.equals">equals</a>(<span class="param">$point</span>);</div><div class="method">yPoint <a href="#method.setLocation">setLocation</a>(<span class="param"></span>);</div><div class="method">yPoint <a href="#method.getLocation">getLocation</a>(<span class="param"></span>);</div><div class="method">yPoint <a href="#method.move">move</a>(<span class="param">$x, $y</span>);</div><div class="method">yPoint <a href="#method.translate">translate</a>(<span class="param">$dx, $dy</span>);</div><div class="method"><a href="#method.setX">setX</a>(<span class="param">$x</span>);</div><div class="method"><a href="#method.setY">setY</a>(<span class="param">$y</span>);</div><div class="method">double <a href="#method.getX">getX</a>(<span class="param"></span>);</div><div class="method">double <a href="#method.getY">getY</a>(<span class="param"></span>);</div>
</div>
}
</div>


</td></tr></table>
</body>
</html>